home *** CD-ROM | disk | FTP | other *** search
- Path: wisdom.connectsoft.net!usenet
- From: mrc@maverick.corus.co.in (Milind R. Changire)
- Newsgroups: comp.lang.c++
- Subject: template: Problem using MFC templates (MSVC 4.0)
- Date: Mon, 22 Jan 1996 09:12:01 GMT
- Message-ID: <4dvk6c$utk@wisdom.connectsoft.net>
- NNTP-Posting-Host: 204.94.124.59
- Keywords: template
- X-Newsreader: Forte Free Agent 1.0.82
-
-
- I am using the CList template class.
- What I want to do is this:
- I want to provide a simple interface to Add, Delete, Find etc. for a
- list.
- So, I have written my own template MyList and provided the functions
- Add(), Delete(), Find() etc.
- The class template is defined as
-
- template <class T>
- class MyList {
- //...
-
- protected :
- CList<T, T> m_List;
-
- };
-
- Now I have a data member as
- CList<T, T> m_List
- in my template class.
- where T is pointer to some class, and CList is a MFC template class.
-
- I use the m_List object to hold the data info.
- I want to have a template object inside my own template class.
- Is this possible ?
-
- Also, I get linker errors like
-
- error LNK2001: unresolved external symbol "public: __thiscall
- MyList<class CTP *>::~MyList<class CTP
- *>(void)"(??1?$MyList@PAVCTP@@@@QAE@XZ)
-
- error LNK2001: unresolved external symbol "public: __thiscall
- MyList<class CTP *>::~MyList<class CTP
- *>(void)"(??1?$MyList@PAVCTP@@@@QAE@XZ)
-
- error LNK2001: unresolved external symbol "public: __thiscall
- MyList<class CTP *>::MyList<class CTP
- *>(void)"(??0?$MyList@PAVCTP@@@@QAE@XZ)
-
- error LNK2001: unresolved external symbol "public: class CTP *
- __thiscall MyList<class CTP *>::Add(class CTP *
- &)"(?Add@?$MyList@PAVCTP@@@@QAEQAVCTP@@AAPAV2@@Z)
-
-
- whereas I have defined all the functions in my template class .CPP
- file. I haven't missed out on a single function.
-
- -Milind Changire
-
-
-